﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.ServiceModel;
using System.Runtime.Serialization;

using System.ComponentModel;

using MSAP.ObjectsStore;

namespace TestObjectsStore
{
    [DataContract]
    public class PersonneRecord : RecordBase<PersonneRecord>
    {
        [DataMember]
        public string Nom {get;set;}
        [DataMember]
        public string Prenom { get; set; }
        [DataMember]
        public List<Telephone> Telephones 
        { 
            get
            {
                if (m_Telephones == null)
                    m_Telephones = new List<Telephone>();
                return m_Telephones;
            }
            set
            {
                m_Telephones = value;
            }
        }
        private List<Telephone> m_Telephones;
    }

    [DataContract]
    public class Telephone 
    {
        public Telephone(string fixe, string mobile, string bureau)
        { 
            Fixe = fixe;
            Mobile=mobile;
            Bureau=bureau;
        }
        [DataMember]
        public string Fixe;
        [DataMember]
        public string Mobile;
        [DataMember]
        public string Bureau;
    }

    public class PersonneSet : RecordSetBase<PersonneRecord>
    {
        public PersonneSet()
        {
            RecordSetBase<PersonneRecord>.RecordSetProvider = SOAPRecordSetProvider<PersonneRecord>.CreateRecordSetProvider();
        }
    }
}
